package com.d0326.Z26;

import java.io.*;

public class FileJava {
    public static void main(String[] args) throws FileNotFoundException {
        FileReader fr=new FileReader(new File("D://a.txt"));
        BufferedReader br= new BufferedReader(fr);
        String str=" ";
        try {
            str=br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        String []str1=str.split(" ");
        int num=0;
        int num1=0;
        int num2=0;
        for (int i = 0; i <str1.length ; i++) {
            System.out.println(str1[i]);
            if(str1[i].equals("interface")){
                num++;
            }else if(str1[i].equals("class")){
                num1++;
            }else if(str1[i].equals("break")){
                num2++;
            }
        }
        System.out.println("interface:"+num);
        System.out.println("class:"+num1);
        System.out.println("break:"+num2);
    }
}
